<extend name="Base:main" />
<block name="script">
	<link rel="stylesheet" href="__PUBLIC__/seller/js/uploadify/uploadify.css" />
	<script src="__PUBLIC__/seller/js/uploadify/jquery.uploadify.min.js"></script>
	<link href="__PUBLIC__/seller/js/editor/themes/default/css/umeditor.css" type="text/css" rel="stylesheet">
    <script type="text/javascript" src="__PUBLIC__/seller/js/editor/third-party/template.min.js"></script>
    <script type="text/javascript" charset="utf-8" src="__PUBLIC__/seller/js/editor/umeditor.config.js"></script>
    <script type="text/javascript" charset="utf-8" src="__PUBLIC__/seller/js/editor/umeditor.min.js"></script>
    <script type="text/javascript" src="__PUBLIC__/seller/js/editor/lang/zh-cn/zh-cn.js"></script>
    <script src="__PUBLIC__/seller/js/calendar/WdatePicker.js"></script>
    	<link rel="stylesheet" href="__PUBLIC__/seller/css/validform.css" />
	<script src="__PUBLIC__/seller/js/Validform_v5.3.2.js"></script>
	<style>
		body{ background:#fff }

		#allmap{margin-left: 27%;height:400px;width:60%;}
		#r-result{width:100%; font-size:14px;}
	</style>
	<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=SC1n3KjGW9rYZGs5tPqpE7dKQnwfcSU9"></script>
</block>
<block name="content">
    <div class="tpl-content-wrapper">
            <div class="tpl-content-page-title">
                资料管理
            </div>
            <ol class="am-breadcrumb">
                <li><a href="#" class="am-icon-home">首页</a></li>
                <li><a href="#">地址管理</a></li>
                <li class="am-active">添加地址</li>
            </ol>
            <div class="tpl-portlet-components">
                <div class="portlet-title">
                      <div class="caption font-green bold">
                        <span class="am-icon-code"></span>添加
                    </div>
                </div>

	<div class="tpl-block ">
		<div class="am-g tpl-amazeui-form">
			<div class="am-u-sm-12 am-u-md-9">
				<form class="am-form am-form-horizontal" request_type="parent" action="" name="myfromSubmit" method="post">
					<div class="am-form-group">
						<label for="user-name" class="am-u-sm-3 am-form-label">收货人</label>
						<div class="am-u-sm-9">
							<span><input type="text" datatype="*"  name="truename" value="{$info.truename}" placeholder="收货人"></span>
							<span><small>例如：xxx</small></span>
						</div>
					</div>
                                        <div class="am-form-group">
						<label for="user-email" class="am-u-sm-3 am-form-label">电话</label>
						<div class="am-u-sm-9">
							<input type="text" datatype="*" value="{$info.phone}" name="phone" placeholder="电话">
						</div>
					</div>
                                        <div class="am-form-group">
						<label for="user-email" class="am-u-sm-3 am-form-label">城市</label>
                                                <div class="am-u-sm-9">
                                                     
                                                    <select id="city" name="city_id"  onchange="theLocation()" class="rcol-xs-10 col-sm-5">
                                                        <volist name="address" id="val">
                                                            <option value="{$val['areaid']}" <?php if($info['city_id'] == $val['areaid']):?>  selected = "selected" <?php endif;?>>{$val['areaname']}</option>
                                                        </volist>
                                                           
                                                    </select>        
                                                      
						</div>
                                        </div>         
					<div class="am-form-group">
						<label for="user-email" class="am-u-sm-3 am-form-label">地址</label>
						<div class="am-u-sm-9">
							<input type="text" datatype="*" value="{$info.address}"  onBlur = "searchLocation()" id="address"  name="address" placeholder="地址">
						</div>
					</div>
                                      <div class="am-form-group">
						<label for="user-email" class="am-u-sm-3 am-form-label">精度</label>
						<div class="am-u-sm-9">
							<input type="text" datatype="*" id="lng" name="lng" type="hidden" value="{$info.lng}">
						</div>
					</div>
                                        <div class="am-form-group">
						<label for="user-email" class="am-u-sm-3 am-form-label">维度</label>
						<div class="am-u-sm-9">
							<input type="text" datatype="*" id="lat" name="lat" type="hidden" value="{$info.lat}">
						</div>
					</div>
                                         <div class="am-form-group">
                                    	<div id="allmap"></div>
                                         </div>
                                      
					<div class="am-form-group">
						<div class="am-u-sm-9 am-u-sm-push-3">
							<input type="hidden" value="{$info.id}" name="id" />
							<button type="submit" class="am-btn am-btn-primary"><notempty name="info">确认修改<else/>确认添加</notempty></button>
						</div>
					</div>
				</form>
                             </div>
                   </div>
           </div>

</div>

	<script>
            	// 百度地图API功能
	var map = new BMap.Map("allmap");
        //初始化
	  $(function(){
                var lng = $("#lng").val();
                var lat = $("#lat").val();
                if(lng && lng){
                    var point = new BMap.Point(lng,lat);
                    map.centerAndZoom(point,11);
                    bImg(lng,lat);
                }else{
                    theLocation();
                }
              
            });
	setTimeout(function(){
		map.setZoom(14);   
	}, 2000);  //2秒后放大到14级
        
	map.enableScrollWheelZoom(true); 
        map.addEventListener("click", showInfo);
       call_submit_back_flag = true;
        function call_submit_back_func() {
                parent.zeroModal.closeAll();
        }
	</script>
</block>